﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NetCore.ORM.Query
{
    public interface  IQuery
    {
        /// <summary>
        /// 获取所有的实例
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="type"></param>
        /// <param name="criterion"></param>
        /// <returns></returns>
        string SelectAll(DbFactoryHelper entity) ;

        /// <summary>
        /// 获取记录总数
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="type"></param>
        /// <param name="criterion"></param>
        /// <returns></returns>
        string RecordCount(DbFactoryHelper entity);

        string RecordCount(string hql);

        /// <summary>
        /// 实体分页查询
        /// </summary>
        /// <param name=""></param>
        /// <param name="grid"></param>
        /// <returns></returns>
        string QueryPage(DbFactoryHelper entity, Order[] order,
            int pageIndex, int pageSize);

       /// <summary>
       /// 通过sql语句进行分页查询
       /// </summary>
       /// <param name="hql"></param>
       /// <param name="orders"></param>
       /// <param name="pageIndex"></param>
       /// <param name="pageSize"></param>
       /// <returns></returns>
        string QueryPage(string hql, Order[] orders,
             int pageIndex, int pageSize);

        /// <summary>
        /// 获取数据库的
        /// </summary>
        /// <returns></returns>
        string GetTable(string DBName);
        /// <summary>
        /// 获取数据库的
        /// </summary>
        /// <returns></returns>
        string GetView(string DBName);
     

        /// <summary>
        /// 获取数据源
        /// </summary>
        /// <param name="tableName"></param>
        /// <param name="grid"></param>
        /// <returns></returns>
        string GetSource(string tableName);
    }
}
